<?php 
error_reporting(0);
ini_set('date.timezone','Asia/Shanghai');
header("Content-type: text/html; charset=utf8");
$lifeTime = 24 * 3600; 
session_set_cookie_params($lifeTime); 
session_start();
  $connarr=array(
    "mysql"=>array(
    "ip"=>"127.0.0.1",  //数据库IP
    "port"=>3306,     //数据库端口
    "user"=>"root",   //数据库账号
    "pass"=>"959b27afcc5fc528",  //数据库密码
    "qudao"=>"1",  //0 关闭 1开启  控制渠道限制登陆
    "aim"=>"xianyun888.net",  //主站域名
    "player"=>"20",  //分享赠送积分
    "data"=>"wan"  //数据库名
    )
  );
$config = $connarr[mysql];
  $qdarr=array(
    "qd"=>array(
    "1"=>"10",  //周一
      "2"=>"10",  //周二
      "3"=>"20",  //周三
      "4"=>"10",  //周四
      "5"=>"10",  //周五
      "6"=>"10",  //周六
      "7"=>"30"  //周日
    )
  );
$qd = $qdarr[qd];

if($_GET[index]=='tui'){
	unset($_SESSION['user']);
    unset($_SESSION['pass']);
	header('location:/index.html?ber='.$dl);
}
$link=mysql_connect($config['ip'],$config['user'],$config['pass']); 
$a=mysql_select_db($config['data'], $link) or die("Unable to connect to the MySQL!");
$conn = new mysqli($config['ip'], $config['user'], $config['pass'], $config['data']);
$source = $_SERVER['HTTP_HOST'];//按逗号分离字符串
$hello = explode('.',$source);
$dlc=$hello[0].'.'.$hello[1].'.'.$hello[2];
$resultkc= mysql_query("SELECT * FROM qudao WHERE aim='$dlc' and aimk='1'", $link);  
$rowkc = mysql_fetch_array($resultkc);
if($rowkc['username']==''){
$dlcc=$hello[0];
}else{
$dlcc=$rowkc['username'];
}
if($dlcc=='www'){
$dl='xianyun';
  if($dlc!='www.'.$config['aim']){
  exit ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>该域名审核中！</title>
  </head>
  <body> 
   <div style="margin:0 auto;width:100%;text-align: center;padding:10px;color:red;">
   该域名审核中！
   </div>  
   </body>
   </html>');
  }
}else{
$dl=$dlcc;
}
#if($dlc=='www'){
#$dl='gm';
#}else{
#$dl=$dlc;
#}
$resultx= mysql_query("SELECT * FROM qudao WHERE username='$dl'", $link);  
$rowx = mysql_fetch_array($resultx);
if($rowx[id]==''){
exit ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>该域名尚未搭建，可以使用!</title>
  </head>
  <body> 
   <div style="margin:0 auto;width:100%;text-align: center;padding:10px;color:red;">
   该域名隶属<艾米玩>旗下,尚未搭建,可以使用!
   </div>  
   </body>
   </html>');
}
if($rowx[gm]=='0'){
$resultxc= mysql_query("SELECT * FROM app WHERE userid='xianyun' and type='0'", $link);  
$rowxc = mysql_fetch_array($resultxc);
$resultyt= mysql_query("SELECT * FROM app WHERE userid='xianyun' and type='1'", $link);  
$rowyt = mysql_fetch_array($resultyt);
}else{
$resultxc= mysql_query("SELECT * FROM app WHERE userid='$dl' and type='0'", $link);  
$rowxc = mysql_fetch_array($resultxc);
$resultyt= mysql_query("SELECT * FROM app WHERE userid='$dl' and type='1'", $link);  
$rowyt = mysql_fetch_array($resultyt);
}
$fhcx = mysql_fetch_array(mysql_query("SELECT * FROM qudao WHERE username='$dl' and qs='1'",$link));
if($fhcx['id']!=''){
exit ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>该域名尚未搭建，可以使用!</title>
  </head>
  <body> 
   <div style="margin:0 auto;width:100%;text-align: center;padding:10px;color:red;">
   该域名隶属<艾米玩>旗下,尚未搭建,可以使用!
   </div>  
   </body>
   </html>');
}

?>